java get object from string name

46

java get object from string name -

try {
	ObjectType instance = getClass().getDeclaredField("name of var").get(ObjectType.class);
} catch (Exception e) {
	e.printStackTrace();
}

Comments

Submit
0 Comments